<!DOCTYPE html>
         <div id="location_table_div">
		<div id="toolbar" class="btn-group">
			<button data-bind="click:addClick" type="button"
				class="btn btn-default">
				<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
			</button>
			<button data-bind="click:editClick" type="button"
				class="btn btn-default">
				<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改
			</button>
		</div>
		
		<!-- 表格，表头里定义了表要显示的字段，data-formatter 里只能跟一个方法名 -->
		<table id="mytable" data-bind="bootstrapTable:$root">
			<thead>
				<tr>
					<th data-checkbox="true"></th>
					<th data-field="name">楼栋名称</th>
				</tr>
			</thead>
		</table>
	</div>

	
<!-- 以下是javascript内容 -->	
<script type="text/javascript">
$(function(){
    var data =  {
	    tableParams : {
	    	url : 'dictionary/location/page'
	    	},
	    	urls : {
	    		delete : 'dictionary/location/delete',
	    		update : 'dictionary/location/edit',
	    		add : 'dictionary/location/edit',
	    		search:'dictionary/location/search'
	    	},
	    	queryCondition : {
	    		name : ''
	    		
	    	}
	};
	ko.applyBindings(new BsTableViewModel(data),document.getElementById('location_table_div'));	
	
});
function typeformatter(value,row,index){
	return value==null?'':value.name;
}
</script>
